package com.orangelife.mobile.pay.biz;

import android.os.Handler;

import com.curry.android.http.VolleyHttpUtil;
import com.orangelife.mobile.constants.Constant;
import com.orangelife.mobile.constants.PayURL;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * 支付的API
 * <p/>
 * Created by 吴格非 on 2016-8-31.
 * <p/>
 *
 * @author 吴格非
 * @since v3.8.2
 */
public class PayHttpBiz {

    /**
     * 钱包支付
     *
     * @param outtradeno 支付流水号
     * @param callback
     */
    public static void payWithWallet(String outtradeno, VolleyHttpUtil.ResponseCallBack callback) {
        HashMap<String, String> urlMap = new HashMap<>();
        urlMap.put("payOrderID", outtradeno);
        VolleyHttpUtil.getInstance().getWithCallback(Constant.URL_BALANCE_PAID, urlMap, callback);
    }

    /**
     * 物业缴费钱包支付
     *
     * @param outtradeno 订单流水号
     * @param callback
     */
    public static void payWithPropertyWallet(String outtradeno, VolleyHttpUtil.ResponseCallBack callback) {
        HashMap<String, String> urlMap = new HashMap<>();
        urlMap.put("payOrderID", outtradeno);
        VolleyHttpUtil.getInstance().getWithCallback(PayURL.PAY_WITH_PROPERTY_WALLET, urlMap, callback);
    }

    /** 获取可用的支付方式 */
    public static void getPaidMethod(String paymentModuleCode, String orderType, Handler handler, int what) {
        HashMap<String, String> urlMap = new HashMap<>();
        urlMap.put("paymentModuleCode", paymentModuleCode);/*将废弃*/
        urlMap.put("orderType", orderType);
        VolleyHttpUtil.getInstance().getWithHandler(PayURL.PAID_METHOD_LIST, handler, what, urlMap);
//        JSONRequest.getInstance().sendRequest(JSONRequest.GET, Constant.URL_PAID_METHOD_LIST, map, handler, PAID_METHOD, HttpUtil.ACTION_URI);
    }

    /** 获取物业缴费钱包信息 */
    public static void getPropertyWalletMoney(VolleyHttpUtil.ResponseCallBack callback) {
        VolleyHttpUtil.getInstance().getWithCallback(PayURL.PROPERTY_WALLET_INFO, callback);
    }


}
